<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $this -> display();
    }
	
    public function regist(){

		$this -> display();
	}

	public function regist_low(){
        //var_dump($_POST);die;
			 $username=$_POST['username'];
			 $pwd=$_POST['pwd'];
			$data=array(
				'username'=>$username,
				'password'=>md5($pwd),

			);
		   if(D('user')->add($data) <=0){
			   echo json_encode(array('state'=>0,'reason'=>'插入失败'));
//			   exit;
		   }
		   echo json_encode(array('state'=>1));

	}

//
}